import Vue from 'vue'
const requireComponent = require.context('./component', false, /[a-z0-9]+\.(vue)$/i)
requireComponent.keys().forEach(fileName => {
  const componentConfig = requireComponent(fileName)
  const componentName = fileName
    .split('/')
    .pop()
    .replace(/\.\w+$/, '')
  Vue.component(componentName, componentConfig.default || componentConfig)
})
